package a02demo2;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;

public class Test2 {
    public static void main(String[] args) {
        HashMap<Integer,String> map1 = new HashMap<>();
        map1.put(1,"a");
        map1.put(2,"b");
        map1.put(3,"c");

       map1.keySet().stream().forEach(new Consumer<Integer>() {
           @Override
           public void accept(Integer integer) {
                       System.out.println(integer);
           }
       });

       map1.entrySet().stream().forEach(new Consumer<Map.Entry<Integer, String>>() {
           @Override
           public void accept(Map.Entry<Integer, String> integerStringEntry) {
                       System.out.println(integerStringEntry);
           }
       });
    }
}
